package com.uduew.sjd.view.xpop;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.uduew.sjd.R;
import com.lxj.xpopup.core.CenterPopupView;

public class ApplyforSuccessfulXpop extends CenterPopupView {
    TextView ApplyforSuccessfulBackTv;
    ImageView ApplyforSuccessfulCloseImg;

    public ApplyforSuccessfulXpop(@NonNull Context context) {
        super(context);
    }

    private DetailsXpop.OnAgreeClickListener onAgreeClickListener;

    public void setOnAgreeClickListener(DetailsXpop.OnAgreeClickListener listener) {
        this.onAgreeClickListener = listener;
    }

    public interface OnAgreeClickListener {
        void onAgreeClick();
    }


    @Override
    protected int getImplLayoutId() {
        return R.layout.xpop_applyfor_successful;
    }

    @Override
    protected void onCreate() {
        super.onCreate();
        ApplyforSuccessfulBackTv = findViewById(R.id.applyforsuccessful_back_tv);
        ApplyforSuccessfulCloseImg = findViewById(R.id.applyforsuccessful_close_img);
        ApplyforSuccessfulBackTv.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onAgreeClickListener != null) {
                    onAgreeClickListener.onAgreeClick();
                }
                dismiss();
            }
        });
        ApplyforSuccessfulCloseImg.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onAgreeClickListener != null) {
                    onAgreeClickListener.onAgreeClick();
                }
                dismiss();
            }
        });
    }


}